package com.itheima.web.service.impl.pms;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.service.pms.ProductCategoryService;
import com.itheima.vo.pms.PmsProductCategory;
import com.itheima.web.mapper.pms.ProductCategoryMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMapper, PmsProductCategory> implements ProductCategoryService {

    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    @Override
    public List<PmsProductCategory> selectByParentId(int i) {
        return productCategoryMapper.selectByParentId(i);
    }

    @Override
    public List<PmsProductCategory> pageByparentId(int parentId, int pageNum, int pageSize) {
        return productCategoryMapper.selectByparentId(parentId,pageNum,pageSize);
    }

    @Override
    public long countByParentId(Integer parentId) {
        return productCategoryMapper.countByParentId(parentId);
    }

    @Override
    public void updateByIds(List<Integer> ids, Integer navStatus) {
        productCategoryMapper.updateByIds(ids,navStatus);
    }

    @Override
    public void updateByIds2(List<Integer> ids, Integer showStatus) {
        productCategoryMapper.updateByIds2(ids,showStatus);
    }

    @Override
    public PmsProductCategory getByName(String name) {
        return productCategoryMapper.getByName(name);
    }
}
